﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ImageProcess
{
    public static class ImageExtension
    {
        public static System.Drawing.Size ConvertSize(this string value)
        {

            try
            {
                string[] tmp = value.Split("x");
                var width = Convert.ToInt32(tmp[0]);
                var height = Convert.ToInt32(tmp[1]);
                return new System.Drawing.Size(width, height);
            }
            catch (Exception)
            {
                return System.Drawing.Size.Empty;
            }
        }
    }
}
